{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Named-entity recognition \n",
    "In the Named-Entity Recognition (NER) task, our goal is to classify the named-entities into the respective predefined category. For instance consider the sentence: Jeremy lives in Paris. In this sentence, 'Jermey' should be categorized as a 'person', and 'Paris' should be categorized as 'location'.\n",
    "\n",
    "Now, let's learn how to finetune the pre-trained BERT for performing the NER task. First, we tokenize the sentence, add the [CLS] token at the beginning and the [SEP] token at the end. Then, we feed the tokens to the pre-trained BERT and obtain the representation of every token. Next, we feed those token representation to a classifier (feedforward network + softmax function). Then the classifier returns the category to which the named-entity belongs to. This is shown in the following figure: \n",
    "\n",
    "\n",
    "![title](images/10.png)\n",
    " Thus, in this way, we can finetune the pre-trained BERT for several downstream tasks. So far, we learned how BERT works and also how to use the pre-trained BERT model. In the next chapter, we will learn about different variants of BERT. "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
